package com.qyer.lxp.lxdao.location.impl;

import com.qyer.lxp.common.framework.contants.QyerMethodNameContants;
import com.qyer.lxp.common.framework.convert.TransformSession;
import com.qyer.lxp.common.framework.core.BaseSpringService;
import com.qyer.lxp.lxdao.location.ILocationDao;
import com.qyer.lxp.model.location.normal.Location;
import com.qyer.lxp.model.location.normal.Locations;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 获取地理位置(国家/城市/区域)信息实现类
 * Created by jiangping on 16/5/13.
 */
@Component
public class LocationDaoImpl extends BaseSpringService implements ILocationDao{
    /**
     * 获取地理位置(国家/城市/区域)信息
     * 功能说明：获取地理位置(国家/城市/区域)信息,
     * 可以获取每个地理位置在力行系统的编码。
     *
     * @return 返回地理信息
     * @throws Exception
     */
    public List<Location> getLocationInfo() throws Exception {

        Locations locations= (Locations) TransformSession.selectOne(QyerMethodNameContants.LX_METHOD_NAME_GETLOCATIONINFO,null,QyerMethodNameContants.LX_CLASS_NAME_LOCATIONS);
        List<Location> locationList = null;
        if(null != locations){
            locationList = locations.getLocationList();
        }
        return locationList;
    }
}
